from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware

import api.health_check
import api.auth_api
import api.ai_api
import exception.exception_handlers
import filter.filters
from config.scaffolding_config import getServerConfig, getCorsConfig

serverConfig = getServerConfig()

app = FastAPI()

origins = getCorsConfig()['origins']

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=False,
    allow_methods=["*"],
    allow_headers=["*"],
)

filter.filters.init_routes(app)
exception.exception_handlers.init_routes(app)

api.health_check.init_routes(app)
api.auth_api.init_routes(app)
api.ai_api.init_routes(app)







